#pragma once
#include "VisioCommon.h"
#include "freeglut.h"
#include "math_3d.h"
#include "Meshes.h"


class CViewerCamera
{
public:
	void Update();
	void SetProjectionParams(float FOV, float Width, float Height, float zNear, float zFar);
	void Move(unsigned char key);
	void Move(int x, int y);
	void Init(float FOV, float Width, float Height, float zNear, float zFar, const Vector3f& Direction, const Vector3f& Position, const Vector3f& Up);
	void OnMouse(int x, int y);
	void OnRender(bool bDrawFocusPoint);
	void SetSpecialPositionTop();
	void SetSpecialPositionNormal();
	void Orbit(int x, int y, Vector3f Center);
	void UpdateMousePos(int x, int y);
	void Zoom(int dir);
	void SetMoseMoveForward(bool b);
	Vector3f GetFocusPoint() const;
	Matrix4f m_ViewTransform;
	Matrix4f m_ProjectionTransform;

	bool m_stop;
private:
	Vector3f m_Position; 
	Vector3f m_Up;
	Vector3f m_Direction;
	Vector3f m_FocusPoint;
	float m_FOV;
	float m_Width;
	float m_Height; 
	float m_zNear; 
	float m_zFar;
	float m_AngleH;
	float m_AngleV;
	bool m_OnUpperEdge;
    bool m_OnLowerEdge;
    bool m_OnLeftEdge;
    bool m_OnRightEdge;
	Vector2i m_mousePos;
	float m_OrbitAngleU;
	float m_OrbitAngleV;
	CPointOfInterest* m_POIMesh;
	bool m_bMoveForawrd;
};